package IC.Semantics.symbols;

import java.util.ArrayList;

import IC.AST.Method;
import IC.Semantics.SemanticError;
import IC.Semantics.types.MethodType;
import IC.Semantics.types.SemanticType;
import IC.Semantics.types.TypeTable;

/**
 * represent a symbol entry of method 
 */
public class MethodSymbol extends SemanticSymbol
{
	/**
	 * standard constructor
	 * @param m
	 * @param className
	 * @throws SemanticError
	 */
	public MethodSymbol(Method m, String className) throws SemanticError {
		super(m.getName(), m.getLine(), TypeTable.getMethodType(m, className), SemanticKind.METHOD );
	}
	
	/**
	 * constructor for fref
	 * @param name
	 * @param list
	 * @param className
	 */
	public MethodSymbol(String name, ArrayList<SemanticType> params, SemanticType retType, boolean isStatic) {
		super(name, 0, new MethodType(name, retType, params, isStatic), SemanticKind.METHOD, true );
	}

	public MethodType getType(){
		return (MethodType) type;
	}
	
}
